home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
NextAnswers
/
1194_converting_hostid_to_enet_address.rtf
< prev
next >
Wrap
Text File
|
1995-06-12
|
695b
|
31 lines
{\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f3\fswiss Helvetica;\f1\fmodern Courier;\f2\fmodern Ohlfs;}
\paperw12000
\paperh9000
\margl120
\margr120
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ulnone\fs28\fc0\cf0 Q: How do I convert a hostid into an Ethernet address?\
\
A: Here is the code to decode a hostid:\
\f3\fs24 \
\f1 main()\
\{\
long hostid;\
long en_address;\
\
hostid = gethostid();\
en_address = (hostid & 0xffffff) + 0x00000f000000;\
\
printf("hostid = 0x%x; en_address = 0x%x.\\n", hostid, en_address);\
\}\
\
\f0\fs28 \
QA261\
\
Valid for 1.0, 2.0, 3.0, 3.1 on NeXT processors\
Not Valid for 3.1 on Intel processors\
\